import axios from "@/libs/api.request";

//设备
export const getDevicePagedList = data => {
  return axios.request({
    params: data,
    url: "/bss/dev/list",
    method: "get"
  });
};
export const getDeviceListExcel = data => {
  return axios.request({
    params: data,
    url: "/bss/dev/export",
    method: "get"
  });
};

export const saveDevice = data => {
  return axios.request({
    data: data,
    url: "/bss/dev/save",
    method: "post",
    headerType: "json"
  });
};

export const updateDevice = data => {
  return axios.request({
    data: data,
    url: "/bss/dev/update",
    method: "post",
    headerType: "json"
  });
};

export const delDevice = data => {
  return axios.request({
    data: data,
    url: "/bss/dev/delete",
    method: "post",
    headerType: "json"
  });
};

export const getShopSelections = data => {
  return axios.request({
    params: data,
    url: "bss/shop/listbydept",
    method: "get"
  });
};

export const bindShop = data => {
  return axios.request({
    data: data,
    url: "bss/dev/bind",
    method: "post",
    headerType: "json"
  });
};

export const unbindShop = data => {
  return axios.request({
    data: data,
    url: "bss/dev/unbind",
    method: "post",
    headerType: "json"
  });
};

//商铺管理
export const getShopPagedList = data => {
  return axios.request({
    params: data,
    url: "/bss/shop/list",
    method: "get"
  });
};
export const getShopListExcel = data => {
  return axios.request({
    params: data,
    url: "/bss/shop/export",
    method: "get"
  });
};

export const saveShop = data => {
  return axios.request({
    data: data,
    url: "/bss/shop/save",
    method: "post",
    headerType: "json"
  });
};

export const updateShop = data => {
  return axios.request({
    data: data,
    url: "/bss/shop/update",
    method: "post",
    headerType: "json"
  });
};

export const delShop = data => {
  return axios.request({
    data: data,
    url: "/bss/shop/delete",
    method: "post",
    headerType: "json"
  });
};

export const uploadShopMap = data => {
  return axios.request({
    data: data,
    url: "/bss/shop/shop_map",
    method: "post",
    headerType: "json"
  });
};


//维保单位
export const getMaintenancePagedList = data => {
  return axios.request({
    params: data,
    url: "/bss/maint/list",
    method: "get"
  });
};

export const saveMaintenance = data => {
  return axios.request({
    data: data,
    url: "/bss/maint/save",
    method: "post",
    headerType: "json"
  });
};

export const updateMaintenance = data => {
  return axios.request({
    data: data,
    url: "/bss/maint/update",
    method: "post",
    headerType: "json"
  });
};

export const delMaintenance = data => {
  return axios.request({
    data: data,
    url: "/bss/maint/delete",
    method: "post",
    headerType: "json"
  });
};

export const getMaintCombo = data => {
  return axios.request({
    data: data,
    url: "/bss/maint/combo",
    method: "get"
  });
};

//维保人员
export const getMUserPagedList = data => {
  return axios.request({
    params: data,
    url: "/bss/muser/list",
    method: "get"
  });
};

export const saveMUser = data => {
  return axios.request({
    data: data,
    url: "/bss/muser/save",
    method: "post",
    headerType: "json"
  });
};

export const updateMUser = data => {
  return axios.request({
    data: data,
    url: "/bss/muser/update",
    method: "post",
    headerType: "json"
  });
};

export const delMUser = data => {
  return axios.request({
    data: data,
    url: "/bss/muser/delete",
    method: "post",
    headerType: "json"
  });
};

export const resetPwd = data => {
  return axios.request({
    data: data,
    url: "/bss/muser/resetpwd",
    method: "post",
    headerType: "json"
  });
};
